<template>
  <el-container class="layout-container">
    <el-header class="header">
      <div class="header-left">
        <h1>🌐 国际化平台管理后台</h1>
      </div>
      <div class="header-right">
        <el-text>API: http://localhost:3000</el-text>
      </div>
    </el-header>
    <el-container>
      <el-aside width="200px" class="sidebar">
        <el-menu
          :default-active="activeMenu"
          router
          class="sidebar-menu"
        >
          <el-menu-item index="/translations">
            <el-icon><Document /></el-icon>
            <span>词条管理</span>
          </el-menu-item>
          <el-menu-item index="/releases">
            <el-icon><Promotion /></el-icon>
            <span>发布管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      
      <el-main class="main-content">
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { Document, Promotion } from '@element-plus/icons-vue'

const route = useRoute()
const activeMenu = computed(() => route.path)
</script>

<style scoped>
.layout-container {
  height: 100vh;
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.header h1 {
  margin: 0;
  font-size: 20px;
}

.sidebar {
  background-color: #f5f5f5;
  border-right: 1px solid #e0e0e0;
}

.sidebar-menu {
  border: none;
  height: 100%;
}

.main-content {
  background-color: #fafafa;
  padding: 20px;
}
</style>

